<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<link
		href="#{facesContext.externalContext.requestContextPath}/css/fibutable.css"
		rel="stylesheet" type="text/css" />
	<title>Tobsns FIBU</title>
	<!--<meta http-equiv="refresh" content="1;url=counter.jsf" />
-->
</h:head>
<h:body>
	<div align="center">
		<h1>Tobsns FIBU</h1>

		<fieldset>
			<legend>Was hesch usge?</legend>
			<h:form>
				<h:messages style="color:RED" />
				<h:outputText value="Was ischs gsi: " />
				<h:inputText id="textInput" value="#{fibuBean.text}"
					display="mutable">
				</h:inputText>

				<br />

				<h:outputText value="Wievill: " />
				<h:inputText id="amountInput" value="#{fibuBean.amount}"
					display="mutable">
					<f:convertNumber minFractionDigits="2" />
				</h:inputText>

				<br />

				<h:outputText value="Vo welem Konto: " />
				<h:selectOneMenu value="#{fibuBean.selectedAccount}">
					<f:selectItems value="#{fibuBean.accountList}" />
					<f:converter converterId="accountConverter" />
				</h:selectOneMenu>
				<br />

				<h:commandButton value="Speichere" action="#{fibuBean.save}" />

				<br />
				<br />
				<br />

				<h:dataTable id="bookingTable" value="#{fibuBean.bookingList}"
					var="item" bgcolor="" border="3" rows="6">
					<f:facet name="header">
						<h:outputText value="Buechige" />
					</f:facet>
					<h:column>
						<f:facet name="header">
							<h:outputText value="Text" />
						</f:facet>
						<h:outputText value="#{item.text}" />
					</h:column>

					<h:column>
						<f:facet name="header">
							<h:outputText value="Wievill" />
						</f:facet>
						<h:outputText value="#{item.amount}">
							<f:convertNumber minFractionDigits="2" />
						</h:outputText>
					</h:column>

					<h:column>
						<f:facet name="header">
							<h:outputText value="Konto" />
						</f:facet>
						<h:outputText value="#{item.debitAccount.accountName}" />
					</h:column>

				</h:dataTable>

				<br />
				<br />

				<h:commandLink value="Kontene" action="#{fibuBean.showAccounts}"
					immediate="true" />
			</h:form>
		</fieldset>
	</div>
</h:body>
</html>